package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.DynamicComment;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.mapper.DynamicCommentMapper;
import cn.wolfcode.trip.base.service.IDynamicCommentService;
import cn.wolfcode.trip.base.util.UserContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DynamicCommentServiceImpl implements IDynamicCommentService {
    @Autowired
    private DynamicCommentMapper dynamicCommentMapper;

    @Override
    public void save(DynamicComment dynamicComment) {
        User currentUser = UserContext.getCurrentUser();
        dynamicComment.setSender(currentUser);
        dynamicCommentMapper.insert(dynamicComment);
    }

    @Override
    public List<DynamicComment> queryAll() {
        return null;
    }
}
